<%--
  Created by IntelliJ IDEA.
  User: 86135
  Date: 2023/3/31
  Time: 15:50
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>会员借阅详情</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- 引入 Bootstrap -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body{
            background-image: url("${pageContext.request.contextPath}/statics/images/bg.png");
        }
    </style>
</head>
<body>

<div class="container">

    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>
                    <small>会员借阅详情</small>
                    <a class="btn btn-primary" href="${pageContext.request.contextPath}/admin/index" style="float: right;">返回</a>
                </h1>
            </div>
        </div>
    </div>

    <div class="row clearfix">
        <div class="col-md-12 column">
            <table class="table table-hover table-striped">
                <thead>
                <tr>
                    <th>书籍图片</th>
                    <th>书籍名字</th>
                    <th>会员帐号</th>
                    <th>剩余时长</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach var="borrow" items="${requestScope.get('borrowsList')}">
                    <tr>
                        <td><img src="${pageContext.request.contextPath}/book/readPhoto?bookISBN=${borrow.getBookISBN()}" width="40px" height="40px"></td>
                        <td>${borrow.getBookName()}</td>
                        <td>${borrow.getUserName()}</td>
                        <td>${borrow.getLength()}</td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
    </div>

    <div align="center">
        <label>第${requestScope.page.getPageCurrent()}/${page.pageCount}页</label>
        <a href="${pageContext.request.contextPath}/admin/toAllBorrowing?pageNo=1">首页</a>
        <a href="${pageContext.request.contextPath}/admin/toAllBorrowing?pageNo=${page.pageCurrent-1}" >上一页</a>
        <a href="${pageContext.request.contextPath}/admin/toAllBorrowing?pageNo=${page.pageCurrent+1}" >下一页</a>
        <a href="${pageContext.request.contextPath}/admin/toAllBorrowing?pageNo=${page.pageCount}">尾页</a> 跳转到:
        <input type="text" style="width:30px" id="turnPage" />页
        <input type="button" onclick="startTurn()" value="跳转" />
    </div>

    <script type="text/javascript">
        function startTurn(){
            var turnPage = document.getElementById("turnPage").value;
            if(turnPage > ${page.pageCount}){
                alert("超过最大页数，请重新输入！");
                return false;
            }
            var shref="${pageContext.request.contextPath}/admin/toAllBorrowing?pageNo="+turnPage;
            window.location.href=shref;
        }
    </script>
</div>

